package com.zengdb.mybatis.service.impl;

import org.apache.ibatis.session.SqlSession;

import com.zengdb.mybatis.dao.QQNumberMapper;
import com.zengdb.mybatis.domain.QQNumber;
import com.zengdb.mybatis.service.IQQNumberService;
import com.zengdb.mybatis.util.MyBatisUtil;

public class QQNumberServiceImpl implements IQQNumberService{

	@Override
	public void saveOne(QQNumber number) {
		//获取SqlSessioon对象
		SqlSession session = MyBatisUtil.openSession();
		QQNumberMapper dao = session.getMapper(QQNumberMapper.class);
		
		//调用dao层的方法
		dao.saveOne(number);
		
		//提交事务
		session.commit();
		
		//释放资源
		session.close();
	}

}
